#!/usr/bin/env python
# -*- coding:utf-8 -*-

# https://www.cnblogs.com/Kobe10/p/5712233.html
# 工具栏

from  tkinter import *


def main():
    root = Tk()

    def callback():
        print('clicked tool bar button')

    # 实现工具条   用Frame实现ToolBar
    toolbar = Frame(root)
    b = Button(toolbar, text='New', width=6, command=callback)
    b.pack(side=LEFT, padx=2, pady=2)  # side  放置的位置      padx   间距

    c = Button(toolbar, text='Open', width=6, command=callback)
    c.pack(side=LEFT, padx=2, pady=2)

    toolbar.pack(side=TOP, fill=X)
    root.mainloop()


if __name__ == "__main__":
    main()
